package com.zl.mapper;

import com.zl.dto.TsRoleDto;
import com.zl.dto.TsRoleSmallDto;
import com.zl.dto.base.PaginationDto;
import com.zl.entity.TsRole;
import com.zl.entity.TsUser;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Set;

@Mapper
public interface RoleMapper {

    TsUser findByUsername(String username);

    TsUser findByEmail(String email);

    void save(TsRoleDto resources);

    long update(TsRoleDto resources);

    long deleteById(Long id);

    long updatePass(@Param("username") String username, @Param("newPaas") String newPaas);

    long updateAvatar(@Param("username") String username, @Param("url") String url);

    Set<TsRole> findByUsersId(Long id);

    List<TsRoleSmallDto> findUsersId(Long id);

    List<TsRole> queryAll();

    List<TsRoleDto> findPaginationByName(@Param("name") String name,PaginationDto<TsRoleDto> p);
}
